package Homework;

import com.sun.org.apache.xerces.internal.impl.xpath.regex.Match;

import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @program: Java_Study
 * @author: Xiaofan
 * @createTime: 2021-07-07 10:39
 * @description: Functions of this class is 提取电话号码
 **/
public class A4 {
    static Pattern pattern1=Pattern.compile("\\d{11}");
    static Pattern pattern2=Pattern.compile("\\d{8}");
    static Pattern pattern3=Pattern.compile("\\d{7}");
    public static void main(String args[]){
        Scanner scanner=new Scanner(System.in);
        while (scanner.hasNext()){
            String s=scanner.next();
            Matcher matcher1=pattern1.matcher(s);
            Matcher matcher2=pattern2.matcher(s);
            Matcher matcher3=pattern3.matcher(s);
            if (matcher1.find()){
                System.out.println(matcher1.group());
            }
            else if (matcher2.find()){
                System.out.println(matcher2.group());
            }
            else if (matcher3.find()){
                System.out.println(matcher3.group());
            }
        }
    }
}